package com.example.demo.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.example.demo.custom.AjaxResult;
import com.example.demo.custom.BaseController;
import com.example.demo.entity.YanBao;
import com.example.demo.form.YanBaoForm;
import com.example.demo.service.YanBaoService;

@RestController
@RequestMapping(value = "/yanbao")
public class YanBaoController extends BaseController<YanBao, Integer, YanBaoForm>{


	@Autowired
	private YanBaoService yanbaoDao;
	
	
	
	@RequestMapping(value="/findbyId")
	public Object byId(YanBaoForm form) {
		YanBao model = new YanBao();
		Integer id = form.getId();
		if(id!=null) {
			 model = yanbaoDao.findById(id);
		}	
		return new AjaxResult(model);
}
}
